defmodule PsqlFunc do
	@moduledoc false

	def id_ts_eq_sql(%{"id" => id, "ts" => ts}, {val_acc, index_acc, str_acc}) do
		ts = TimeLib.string_to_date(ts) || PrivateCandy.debug_remind(__ENV__, "#{ts} input_error")
		str = "(id=$#{index_acc} and ts=$#{index_acc + 1})"
		{[ts, id | val_acc], index_acc + 2, [str | str_acc]}
	end
	def id_ts_eq_sql(id, acc) do
		PrivateCandy.debug_remind(__ENV__, "#{inspect(id)} #{inspect(acc)} input_error")
	end


end
